So I have a DB that contains two lists, the first list is already populated with a defined array, and the second list shows another array based on what is chosen in the first list.
I used the set function to callback another function whenever something is chosen in the first list, so it can generate a new array for the second list.
As of now, I made the callback function close and recreate the DB so that it shows an updated second list, but I was wondering if theres a smarter way to update a DB?
ie. pseudocode
string t []
void cb {
get(list1)
based on what list1 is selected as, it will change the array t for list 2
hide db //here i am hiding, or destroying the db and recalling the main
main() //recreate the db with an updated list
}
void main {
string s [] = {a, b, c, d}
DB db = create "main"
DBE list1 = list(etc.., s)
DBE list 2 = list(etc.., t)
set(list1, cb)
}
main()
phan423 - Wed Feb 22 14:35:49 EST 2012 |
Re: Update DB Coffy - Tue Feb 28 05:19:12 EST 2012
Hello,
in the db function you can use the insert and delete function for populate the list2. This is not a perfect solution but can use.
delete(list2,0)
insert(list2,0, "data1")
......
....
it is necessary, that when you create a list2 in the main, you create a big empty list!!!!
Sorry for my english.
hi.
|